//WdgElementaryPlotRoutines.cpp
/*    widgetpp - A simple C++ wrapper of DISLIN graphic library               */
/*                                                                            */
/*    Copyright (C) 2012  Mirko Cambi (email: mirko.cambi@gmail.com)          */
/*                                                                            */
/*    This program is free software: you can redistribute it and/or modify    */
/*    it under the terms of the GNU General Public License as published by    */
/*    the Free Software Foundation, either version 3 of the License, or       */
/*    (at your option) any later version.                                     */
/*                                                                            */
/*    This program is distributed in the hope that it will be useful,         */
/*    but WITHOUT ANY WARRANTY; without even the implied warranty of          */
/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
/*    GNU General Public License for more details.                            */
/*                                                                            */
/*    You should have received a copy of the GNU General Public License       */
/*    along with this program.  If not, see <http://www.gnu.org/licenses/>.   */

#include "WdgElementaryPlotRoutines.hpp"

#include "dislin.h"

const unsigned int
   wdgpp::reference::axis = 0,
   wdgpp::reference::page = 1;
   

void wdgpp::move(float x, float y, int ref)
{
   if(!ref)
      rlstrt(x, y);
   else
      xmove(static_cast<int>(x), static_cast<int>(y));
}

void wdgpp::draw(float x, float y, int ref)
{
   if(!ref)
      rlconn(x, y);
   else
      xdraw(static_cast<int>(x), static_cast<int>(y));
}
   
void wdgpp::line(float x, float y, float u, float v, int ref)
{
   if(!ref)
      rline(x, y, u, v);
   else
      line(static_cast<int>(x), static_cast<int>(y), static_cast<int>(u), static_cast<int>(v));
}

const int
   wdgpp::arrow::ratio::zero  = 0,
   wdgpp::arrow::ratio::one   = 1000,       
   wdgpp::arrow::ratio::two   = 2000,
   wdgpp::arrow::ratio::three = 3000,
   wdgpp::arrow::ratio::four  = 4000,      
   wdgpp::arrow::ratio::five  = 5000,
   wdgpp::arrow::ratio::six   = 6000,                                          
   wdgpp::arrow::ratio::seven = 7000,
   wdgpp::arrow::ratio::eight = 8000, 
   wdgpp::arrow::ratio::nine  = 9000;

const int
   wdgpp::arrow::size::zero  = 0,
   wdgpp::arrow::size::one   = 100,
   wdgpp::arrow::size::two   = 200,
   wdgpp::arrow::size::three = 300,
   wdgpp::arrow::size::four  = 400,            
   wdgpp::arrow::size::five  = 500,
   wdgpp::arrow::size::six   = 600,
   wdgpp::arrow::size::seven = 700,     
   wdgpp::arrow::size::eight = 800,
   wdgpp::arrow::size::nine  = 900;           

const int
   wdgpp::arrow::form::filled      = 00,
   wdgpp::arrow::form::not_filled  = 10,
   wdgpp::arrow::form::opened      = 20,
   wdgpp::arrow::form::closed      = 30;
                                                  
const int          
   wdgpp::arrow::position::no_head        = 0,
   wdgpp::arrow::position::at_end         = 1,
   wdgpp::arrow::position::both           = 2,
   wdgpp::arrow::position::same_direction = 3;

void wdgpp::vector(float x1, float y1, float x2, float y2, int vec, int ref)
{
   if(!ref)
      rlvec(x1, y1, x2, y2, vec);
   else
      vector(static_cast<int>(x1), static_cast<int>(y1), static_cast<int>(x2), static_cast<int>(y2), vec);
}

void wdgpp::circle(float x, float y, float r, int ref)
{
   if(!ref)
      rlcirc(x, y, r);
   else
      ::circle(static_cast<int>(x), static_cast<int>(y), static_cast<int>(r));
}

